From: Giovanni Campagna Date: Tue, 28 Jan 2014 22:19:48 +0000 (+0100) Subject: Revert "network: Use NMDevice.get_available_connections(); for NMWirelessDialog" X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2824 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a4adcba4058f8b76f03f2b6c47ce6950811b144a;p=gnome-shell.git Revert "network: Use NMDevice.get_available_connections(); for NMWirelessDialog" This reverts commit a36bfced473d48ffe70150ad5537bb82b1ead8e8. get_available_connections() returns the connections that are available right now, ie, with the currently visible APs, but that might change while the dialog is open, so we can't use it. https://bugzilla.gnome.org/show_bug.cgi?id=709128 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 696e898cd..0520abf99 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -658,7 +658,7 @@ const NMWirelessDialog = new Lang.Class({ Name: 'NMWirelessDialog', Extends: ModalDialog.ModalDialog, - _init: function(client, device) { + _init: function(client, device, settings) { this.parent({ styleClass: 'nm-dialog' }); this._client = client; @@ -674,7 +674,10 @@ const NMWirelessDialog = new Lang.Class({ this._networks = []; this._buildLayout(); - this._connections = device.get_available_connections(); + let connections = settings.list_connections(); + this._connections = connections.filter(Lang.bind(this, function(connection) { + return device.connection_valid(connection); + })); this._apAddedId = device.connect('access-point-added', Lang.bind(this, this._accessPointAdded)); this._apRemovedId = device.connect('access-point-removed', Lang.bind(this, this._accessPointRemoved)); @@ -1101,9 +1104,10 @@ const NMDeviceWireless = new Lang.Class({ Name: 'NMDeviceWireless', category: NMConnectionCategory.WIRELESS, - _init: function(client, device) { + _init: function(client, device, settings) { this._client = client; this._device = device; + this._settings = settings; this._description = ''; @@ -1171,7 +1175,7 @@ const NMDeviceWireless = new Lang.Class({ }, _showDialog: function() { - this._dialog = new NMWirelessDialog(this._client, this._device); + this._dialog = new NMWirelessDialog(this._client, this._device, this._settings); this._dialog.connect('closed', Lang.bind(this, this._dialogClosed)); this._dialog.open(); },